package test;

import db.MyHibernateSessionFactory;
import org.hibernate.Session;
import selcoursesys.action.SelectionAction;
import selcoursesys.dao.CourseDAO;
import selcoursesys.dao.impl.BaseHibernateDAOImpl;
import selcoursesys.dao.impl.CourseDAOImpo;
import selcoursesys.entity.AcademyEntity;
import selcoursesys.entity.CourseEntity;

import java.util.Iterator;
import java.util.List;

/**
 * Created by Lpbdz on 2017/4/9.
 */
public class testCourse extends BaseHibernateDAOImpl{
    public static void main(String[] args) {
        testCourse mto = new testCourse();
        mto.testManytoOne();
    }
        /**
        CourseDAO courseDAO=new CourseDAOImpo();
        List<CourseEntity> list=courseDAO.checkCourse(courseEntity);
        Iterator itor=list.iterator();
        while(itor.hasNext()){
            CourseEntity courseEntity1=(CourseEntity)itor.next();
            //UserEntity user=(UserEntity)itor.next();
            System.out.println(courseEntity1.getCourseid());
        }
         public void testManytoOne(){
       //Session session= MyHibernateSessionFactory.getSession();
        //CourseEntity courseEntity1=(CourseEntity)super.get(CourseEntity.class,"CS0001");
        SelectionAction selectionAction=new SelectionAction();
        try{
            selectionAction.showDetailCourse();
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            return;
        }
        //System.out.println(courseEntity1.getAcademyEntity().getAid());
         */
        public void testManytoOne(){
           try{
               SelectionAction selectionAction=new SelectionAction();
               //System.out.print(selectionAction.showElectiveInfo());
              System.out.print( selectionAction.checkCourseTime());
           }catch (Exception e){
               e.printStackTrace();
           }finally {
               return;
           }
    }
}
